<?php
$this->pageTitle=Yii::t('site', 'Order');
?>
<div class="form">
<form method="post" action="">
<input type="hidden" name="WIDout_trade_no" value="<?php echo $model->_id; ?>" />
	<div data-role="fieldcontain">
        <label><?php echo Yii::t('site', 'Order No'); ?>:</label>
        <label><?php echo $model->_id; ?></label>
	</div>
	<div data-role="fieldcontain">
		<label><?php echo Yii::t('site', 'Total Amount'); ?>:</label>
        <label>$<?php echo $model->amount; ?></label>
	</div>
	<div data-role="fieldcontain">
		<label><?php echo Yii::t('site', 'Status'); ?>:</label>
        <label><?php echo Yii::t('site', $model->getOrderStatus($model->status)); ?></label>
	</div>
<?php
if ($model->status == BSMBooking::STATUS_BOOKED) {
?>
	<div data-role="fieldcontain">
        <button class="ui-btn ui-btn-inline" onclick="return cancelIt(this.form)"><?php echo Yii::t('site', 'Cancel Booking'); ?></button>
	</div>
<?php
}
?>
</form>
</div><!-- form -->
<script>
function cancelIt(frmThis) {
    if (confirm("<?php echo Yii::t('site', 'Are you sure to cancel this order?'); ?>")) {
        frmThis.action = "<?php echo Yii::app()->createUrl('stadium/cancelOrder'); ?>";
        return true;
    }

    return false;
}
</script>
<?php
if ($dataProvider->getTotalItemCount() > 0) {
    $this->widget('ext.mobile.ListView', array(
        'dataProvider'=>$dataProvider,
        'dividerName'=>'',
        'itemView'=>'_viewBooking',
        'dataFilter'=>false
    ));
}
?>
